﻿function GetRequest() {
    var url = location.search; //获取url中"?"符后的字串
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for (var i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
        }
    }
    return theRequest;
}

var peopleMsg = new Array(9);
var peopleTotalDay = new Array(9);
var peoplePlanDay = new Array(9);
for(var i = 1; i < 9; i++){
    peopleMsg[i] = 0;       //每个工作内容共有多少人 = 总rowspan
    peopleTotalDay[i] = 0;  //总(含税)  = 总rowspan
    peoplePlanDay[i] = 0;   //计划日   = 总rowspan
}
var peopleMoney = new Array(19);
var peopleNum = new Array(19);
var jobTotalDay = new Array(19);
var systemTotalNum = new Array(8);
for(var i = 1; i < 19; i++) {
    peopleMoney[i] = 0;     // = 分rowspan
    peopleNum[i] = 0;       // = 分rowspan
    jobTotalDay[i] = 0;
}
for(var i = 0; i < 8; i++) {
    systemTotalNum[i] = 0;
}

var peopleMsg_1_xqfx = 0;
var peopleMsg_1_cpjl = 0;
var peopleMsg_2_cpjl = 0;
var peopleMsg_2_yyjg = 0;
var peopleMsg_2_jcpt = 0;
var peopleMsg_2_khd = 0;
var peopleMsg_2_qd = 0;
var peopleMsg_2_ui = 0;
var peopleMsg_3_java = 0;
var peopleMsg_3_az = 0;
var peopleMsg_3_pg = 0;
var peopleMsg_3_c = 0;
var peopleMsg_3_qd = 0;
var allMsg;
var system2job;
var system2fun;
var projectName;
var data;
layui.use(['form','code','laydate'], function(){
    var laydate = layui.laydate;
    //执行一个laydate实例
    laydate.render({
        elem: '#deadline' //指定元素
    });
    form = layui.form;
    layui.code();
    $('#site').xcity('','','');
    var a=GetRequest();
    var tableid = a['id'];
    //初始化:接收数据
    if(tableid){
        $.ajax({
            url: "/ht/getHt",   //有tableId说明已经插入过了
/*            type: "POST",
            dateType: "json",
            contentType : "application/json",
            data:
                JSON.stringify({
                    level1SystemId: tableid
                }),*/
            type: "get",
            data: {
                    level1SystemId: tableid
                },
            success: function(val) {
                console.log(val);
                var jsonText = JSON.stringify(val);
                var strArr = new Array();
                strArr = jsonText.split('System2fun":[');
                var str = strArr.join('System2fun":');
                strArr[0] = str.substr(0, str.length-3);
                strArr[1] = str.substr(str.length-2, str.length);
                str = strArr.join('');
                var res = JSON.parse(str);
                console.log(res);
                if(res.msg == 'success') {
                    console.log(res.data);
                    console.log(res.data.System2fun);
                    data = res.data;
                    layer.msg("加载数据成功...")
                    allMsg = res.data.WorkPlan;
                    system2job = res.data.System2job;
                    system2fun = res.data.System2fun;
                    projectName = res.data.System1.projectName;
                    form.val('firstTable', {
                        "tableId": res.data.System1.level1SystemId,
                        "modeId": res.data.System1.modeId,
                        "projectName": res.data.System1.projectName,
                        "businessName": res.data.System1.customerName,
                        "chiefName": res.data.System1.headName,
                        "chiefPhone": res.data.System1.headPhone,
                        "chiefEmail": res.data.System1.headEmail,
                        "deadline": res.data.System1.deliveryTime,
                        "content": res.data.System1.deliverables,
                        "method": res.data.System1.deliveryWay,
                        "street": res.data.System1.deliveryPlace
                    });
                    for(let i = 0; i < allMsg.length; i++){
                        switch(res.data.WorkPlan[i].typeId){
                            case 1 : {
                                peopleMsg[1]++;
                                peoplePlanDay[1] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[1] += res.data.WorkPlan[i].totalDay;
                                switch(res.data.WorkPlan[i].site){
                                    case 1 : {
                                        peopleMsg_1_cpjl++;
                                        peopleMoney[1]=res.data.WorkPlan[i].money;
                                        peopleNum[1]=res.data.WorkPlan[i].num;
                                    }; break;
                                    case 2 : {peopleMsg_1_xqfx++; peopleMoney[2]=res.data.WorkPlan[i].money; peopleNum[2]=res.data.WorkPlan[i].num}; break;
                                }
                            }; break;
                            case 2 : {
                                peopleMsg[2]++;
                                peoplePlanDay[2] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[2] += res.data.WorkPlan[i].totalDay;
                                switch(res.data.WorkPlan[i].site){
                                    case 1 : {peopleMsg_2_cpjl++; peopleMoney[3]=res.data.WorkPlan[i].money; peopleNum[3]=res.data.WorkPlan[i].num}; break;
                                    case 3 : {peopleMsg_2_yyjg++; peopleMoney[4]=res.data.WorkPlan[i].money; peopleNum[4]=res.data.WorkPlan[i].num}; break;
                                    case 4 : {peopleMsg_2_jcpt++; peopleMoney[5]=res.data.WorkPlan[i].money; peopleNum[5]=res.data.WorkPlan[i].num}; break;
                                    case 5 : {peopleMsg_2_khd++;  peopleMoney[6]=res.data.WorkPlan[i].money; peopleNum[6]=res.data.WorkPlan[i].num}; break;
                                    case 6 : {peopleMsg_2_qd++;   peopleMoney[7]=res.data.WorkPlan[i].money; peopleNum[7]=res.data.WorkPlan[i].num}; break;
                                    case 7 : {peopleMsg_2_ui++;   peopleMoney[8]=res.data.WorkPlan[i].money; peopleNum[8]=res.data.WorkPlan[i].num}; break;
                                }
                            }; break;
                            case 3 : {
                                peopleMsg[3]++;
                                peoplePlanDay[3] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[3] += res.data.WorkPlan[i].totalDay;
                                switch(res.data.WorkPlan[i].site){
                                    case 8  : {peopleMsg_3_java++; peopleMoney[9]=res.data.WorkPlan[i].money;  peopleNum[9]=res.data.WorkPlan[i].num}; break;
                                    case 9  : {peopleMsg_3_az++;   peopleMoney[10]=res.data.WorkPlan[i].money; peopleNum[10]=res.data.WorkPlan[i].num}; break;
                                    case 10 : {peopleMsg_3_pg++;   peopleMoney[11]=res.data.WorkPlan[i].money; peopleNum[11]=res.data.WorkPlan[i].num}; break;
                                    case 11 : {peopleMsg_3_c++;    peopleMoney[12]=res.data.WorkPlan[i].money; peopleNum[12]=res.data.WorkPlan[i].num}; break;
                                    case 12 : {peopleMsg_3_qd++;   peopleMoney[13]=res.data.WorkPlan[i].money; peopleNum[13]=res.data.WorkPlan[i].num}; break;
                                }
                            }; break;
                            case 4 : {
                                peopleMsg[4]++;
                                peopleNum[14]=res.data.WorkPlan[i].num;
                                peoplePlanDay[4] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[4] += res.data.WorkPlan[i].totalDay;
                                peopleMoney[14]=res.data.WorkPlan[i].money;
                            }; break;
                            case 5 : {
                                peopleMsg[5]++;
                                peopleNum[15]=res.data.WorkPlan[i].num;
                                peoplePlanDay[5] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[5] += res.data.WorkPlan[i].totalDay;
                                peopleMoney[15]=res.data.WorkPlan[i].money;
                            }; break;
                            case 6 : {
                                peopleMsg[6]++;
                                peopleNum[16]=res.data.WorkPlan[i].num;
                                peoplePlanDay[6] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[6] += res.data.WorkPlan[i].totalDay;
                                peopleMoney[16]=res.data.WorkPlan[i].money;
                            }; break;
                            case 7 : {
                                peopleMsg[7]++;
                                peopleNum[17]=res.data.WorkPlan[i].num;
                                peoplePlanDay[7] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[7] += res.data.WorkPlan[i].totalDay;
                                peopleMoney[17]=res.data.WorkPlan[i].money;
                            }; break;
                            case 8 : {
                                peopleMsg[8]++;
                                peopleNum[18]=res.data.WorkPlan[i].num;
                                peoplePlanDay[8] += res.data.WorkPlan[i].planDay;
                                peopleTotalDay[8] += res.data.WorkPlan[i].totalDay;
                                peopleMoney[18]=res.data.WorkPlan[i].money;
                            }; break;
                        }
                    }
                    var num = 0;
                    for(var i = 1; i < 9; i++){ //遍历一下json数据
                        if(peopleMsg[i] > 0)
                            var trow = getDataRow(i, num); //定义一个方法,返回tr数据  
                        num += peopleMsg[i];
                        //tbody.appendChild(trow);  
                    }
                    console.log(system2fun);
                    getDataRow2(1, system2job.s1, system2fun.s1);
                    getDataRow2(2, system2job.s2, system2fun.s2);
                    getDataRow2(3, system2job.s3, system2fun.s3);
                    getDataRow2(41, system2job.s41, system2fun.s41);
                    getDataRow2(42, system2job.s42, system2fun.s42);
                    getDataRow2(43, system2job.s43, system2fun.s43);
                    getDataRow2(44, system2job.s44, system2fun.s44);
                    getDataRow2(45, system2job.s45, system2fun.s45);
                } else {
                    alert("加载数据失败..");
                }
            }
        });
    }
});


function isEmpty(val){
    if(val == 'null' || val == null || val == 'undefined' || val == ''){
        return '';
    } else {
        return val;
    }
}

function returnValue(val){
    if(val == ''){
        return 0;
    } else {
        return val;
    }
}

function returnBlank(val){
    if(val == '0' || val == 0){
        return '';
    } else {
        return val;
    }
}

function getDataRow(site, startNum){
    var rowSum = document.createElement('tr'); //创建行  
    var sumCell_1 = document.createElement('td');
    var sumCell_2 = document.createElement('td');
    var sumCell_3 = document.createElement('td');
    var sumCell_4 = document.createElement('td');
    var sumCell_5 = document.createElement('td');
    var sumCell_6 = document.createElement('td');
    var sumCell_7 = document.createElement('td');
    var sumCell_8 = document.createElement('td');
    var sumCell_9 = document.createElement('td');
    var sumCell_10 = document.createElement('td');
    var sumCell_11 = document.createElement('td');
    var s_index = startNum;    //从data[index]开始遍历
    var countMoney = 0; //合计
    var money = new Array();    //单价
    var num = new Array();      //人数
    var totalMoney = new Array();   //小计
    var planDay = new Array();  //计划人日(人数计算)
    var totalDay = new Array();  //含税人日(人数计算)
    var name = new Array(); //姓名(人数计算)
    var countNumPerJob = 0;
    var i = 0;
    var k = 0;
    var flag = 0;   //是否设置了总工作内容
    var jobText = new Array();
    jobText.push("", "产品经理", "需求分析师", "产品经理", "应用架构师", "基础平台设计师", "客户端（app）设计师",
        "前端设计设计师", "UI设计师", "java开发工程师", "安卓开发工程师", "苹果开发工程师", "C#开发工程师",
        "前端开发工程师", "测试工程师", "业务经理", "实施工程师", "项目总监", "技术总监");
    var tbody = document.getElementById('table2');

    switch(site){
        case 1 : {
            if(peopleMsg_1_cpjl > 0) {
                flag = 1;
                money.push(peopleMoney[1]);     //记录每个岗位单价
                num.push(peopleNum[1]);     //记录每个岗位人数
                for(; i < peopleMsg_1_cpjl; i++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[1] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[1]));   //小计
                k++;
            }
            if(peopleMsg_1_xqfx > 0) {
                if(flag == 0) flag = 2;
                money.push(peopleMoney[2]);
                num.push(peopleNum[2]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_1_xqfx; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[2] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[2])); //小计
                k++;
            }
            for(let j = 0; j < k; j++)  {
                countMoney += totalMoney[j];    //合计
            }
            /* 设置总的内容 */
            sumCell_1.innerHTML = '需求调研'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[1]);
            sumCell_2.innerHTML = peoplePlanDay[1]; //计划日
            //sumCell_2.style.cssText="font-size: 16px"
            sumCell_2.setAttribute('rowspan', peopleMsg[1]);
            sumCell_3.innerHTML = peopleTotalDay[1]; //含税日
            //sumCell_3.style.cssText="font-size: 16px"
            sumCell_3.setAttribute('rowspan', peopleMsg[1]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">' + jobText[flag] + '</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[flag]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[flag]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[flag]);
            sumCell_6.innerHTML = peopleNum[flag];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[flag]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[flag]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[1]);
            //sumCell_11.style.cssText="font-size: 16px"
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);

            let m = 1;
            for(; m < peopleMsg_1_cpjl; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
            if(flag == 2) { //产品经理无数据(总的标记从2开始)
                for(; m < peopleMsg_1_xqfx; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else {    //产品经理有数据
                if(peopleMsg_1_xqfx > 0) {  //需求分析师有数据
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">需求分析师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[2]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[2]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[2]);
                    sumCell_3.innerHTML = peopleNum[2];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[2]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[1]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[2]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_1_xqfx; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
        }; break;

        case 2 : {
            if(peopleMsg_2_cpjl > 0) {
                flag = 3;
                money.push(peopleMoney[3]);     //记录每个岗位单价
                num.push(peopleNum[3]);     //记录每个岗位人数
                for(; i < peopleMsg_2_cpjl; i++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[3] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[3]));   //小计
                k++;
            }
            if(peopleMsg_2_yyjg > 0) {
                if(flag == 0) flag = 4;
                money.push(peopleMoney[4]);
                num.push(peopleNum[4]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_2_yyjg; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[4] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[4])); //小计
                k++;
            }
            if(peopleMsg_2_jcpt > 0) {
                if(flag == 0) flag = 5;
                money.push(peopleMoney[5]);
                num.push(peopleNum[5]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_2_jcpt; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[5] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[5])); //小计
                k++;
            }
            if(peopleMsg_2_khd > 0) {
                if(flag == 0) flag = 6;
                money.push(peopleMoney[6]);
                num.push(peopleNum[6]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_2_khd; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[6] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[6])); //小计
                k++;
            }
            if(peopleMsg_2_qd > 0) {
                if(flag == 0) flag = 7;
                money.push(peopleMoney[7]);
                num.push(peopleNum[7]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_2_qd; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[7] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[7])); //小计
                k++;
            }
            if(peopleMsg_2_ui > 0) {
                if(flag == 0) flag = 8;
                money.push(peopleMoney[8]);
                num.push(peopleNum[8]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_2_ui; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[8] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[8])); //小计
                k++;
            }
            for(let j = 0; j < k; j++)  {
                countMoney += totalMoney[j];    //合计
            }
            /* 设置总的内容 */
            sumCell_1.innerHTML = '系统设计'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[2]);
            sumCell_2.innerHTML = peoplePlanDay[2]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[2]);
            sumCell_3.innerHTML = peopleTotalDay[2]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[2]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">' + jobText[flag] + '</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[flag]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[flag]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[flag]);
            sumCell_6.innerHTML = peopleNum[flag];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[flag]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[flag]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[2]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            let m = 1;
            let p = 1;
            for(; m < peopleMsg_2_cpjl; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
            if(flag == 4) { //总的标记从4开始
                for(; m < peopleMsg_2_yyjg; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 3) {    //产品经理有数据
                if(peopleMsg_2_yyjg > 0) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">应用架构设计师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[4]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[3]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[4]);
                    sumCell_3.innerHTML = peopleNum[3];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[4]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[4]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_2_yyjg; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 5) { //总的标记从5开始
                for(; m < peopleMsg_2_jcpt; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 3 || flag == 4) {
                if(peopleMsg_2_jcpt > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">基础平台设计师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[5]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[5]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[5]);
                    sumCell_3.innerHTML = peopleNum[5];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[5]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[5]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_2_jcpt; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 6) { //总的标记从5开始
                for(; m < peopleMsg_2_kdh; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 3 || flag == 4 || flag == 5) {
                if(peopleMsg_2_khd > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">客户端（app）设计师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[6]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[6]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[6]);
                    sumCell_3.innerHTML = peopleNum[6];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[6]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[6]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_2_khd; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 7) { //总的标记从5开始
                for(; m < peopleMsg_2_qd; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 3 || flag == 4 || flag == 5 || flag == 6) {
                if(peopleMsg_2_qd > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">前端设计设计师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[7]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[7]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[7]);
                    sumCell_3.innerHTML = peopleNum[7];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[7]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[7]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_2_qd; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 8) { //总的标记从5开始
                for(; m < peopleMsg_2_ui; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 3 || flag == 4 || flag == 5 || flag == 6 || flag == 7) {
                if(peopleMsg_2_ui > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">UI设计师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[8]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[8]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[8]);
                    sumCell_3.innerHTML = peopleNum[8];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[8]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[8]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_2_ui; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
        }; break;

        case 3 : {
            if(peopleMsg_3_java > 0) {
                flag = 9;
                money.push(peopleMoney[9]);     //记录每个岗位单价
                num.push(peopleNum[9]);     //记录每个岗位人数
                for(; i < peopleMsg_3_java; i++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[9] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[9]));   //小计
                k++;
            }
            if(peopleMsg_3_az > 0) {
                if(flag == 0) flag = 10;
                money.push(peopleMoney[10]);
                num.push(peopleNum[10]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_3_az; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[10] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[10])); //小计
                k++;
            }
            if(peopleMsg_3_pg > 0) {
                if(flag == 0) flag = 11;
                money.push(peopleMoney[11]);
                num.push(peopleNum[11]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_3_pg; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[11] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[11])); //小计
                k++;
            }
            if(peopleMsg_3_c > 0) {
                if(flag == 0) flag = 12;
                money.push(peopleMoney[12]);
                num.push(peopleNum[12]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_3_c; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[12] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[12])); //小计
                k++;
            }
            if(peopleMsg_3_qd > 0) {
                if(flag == 0) flag = 13;
                money.push(peopleMoney[13]);
                num.push(peopleNum[13]);
                countNumPerJob = 0;
                for(var f = 0; f < peopleMsg_3_qd; f++) {
                    planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                    totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                    jobTotalDay[13] += returnValue(isEmpty(allMsg[s_index].totalDay));
                    name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                    countNumPerJob += returnValue(totalDay[i++]);
                }
                totalMoney.push(countNumPerJob*returnValue(peopleMoney[13])); //小计
                k++;
            }
            for(let j = 0; j < k; j++)  {
                countMoney += totalMoney[j];    //合计
            }
            /* 设置总的内容 */
            sumCell_1.innerHTML = '系统开发'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[3]);
            sumCell_2.innerHTML = peoplePlanDay[3]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[3]);
            sumCell_3.innerHTML = peopleTotalDay[3]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[3]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">' + jobText[flag] + '</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[flag]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[flag]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[flag]);
            sumCell_6.innerHTML = peopleNum[flag];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[flag]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[flag]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[3]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            let m = 1;
            let p = 1;
            for(; m < peopleMsg_3_java; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
            if(flag == 10) { //总的标记从4开始
                for(; m < peopleMsg_3_az; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 9) {    //产品经理有数据
                if(peopleMsg_3_az > 0) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">安卓开发工程师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[10]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[10]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[10]);
                    sumCell_3.innerHTML = peopleNum[10];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[10]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[10]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_3_az; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 11) { //总的标记从5开始
                for(; m < peopleMsg_3_pg; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 9 || flag == 10) {
                if(peopleMsg_3_pg > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">苹果开发工程师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[11]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[11]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[11]);
                    sumCell_3.innerHTML = peopleNum[11];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[11]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[11]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_3_pg; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 12) { //总的标记从5开始
                for(; m < peopleMsg_3_c; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 9 || flag == 10 || flag == 11) {
                if(peopleMsg_3_c > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">C#开发工程师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[12]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[12]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[12]);
                    sumCell_3.innerHTML = peopleNum[12];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[12]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[12]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_3_c; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
            if(flag == 13) { //总的标记从5开始
                for(; m < peopleMsg_3_qd; m++) {  //第二个人开始
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            } else if(flag == 9 || flag == 10 || flag == 11 || flag == 12) {
                if(peopleMsg_3_qd > 0) {
                    var row = document.createElement('tr');
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    var sumCell_4 = document.createElement('td');
                    var sumCell_5 = document.createElement('td');
                    var sumCell_6 = document.createElement('td');
                    var sumCell_7 = document.createElement('td');
                    sumCell_1.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">前端开发工程师</button>'; //岗位
                    sumCell_1.setAttribute('rowspan', peopleNum[13]);
                    sumCell_2.innerHTML = isEmpty(peopleMoney[13]);   //岗位单价
                    sumCell_2.setAttribute('rowspan', peopleNum[13]);
                    sumCell_3.innerHTML = peopleNum[13];   //岗位人数
                    sumCell_3.setAttribute('rowspan', peopleNum[13]);
                    sumCell_4.innerHTML = name[m];   //第一个人名
                    sumCell_5.innerHTML = planDay[m];   //第一个人日
                    sumCell_6.innerHTML = totalDay[m++];   //第一个税日
                    sumCell_7.innerHTML = totalMoney[p++]; //小计
                    sumCell_7.setAttribute('rowspan', peopleNum[13]);
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3)
                    row.appendChild(sumCell_4)
                    row.appendChild(sumCell_5)
                    row.appendChild(sumCell_6)
                    row.appendChild(sumCell_7)
                    tbody.appendChild(row);
                }
                for(let n = 1; n < peopleMsg_3_qd; n++) {
                    var row = document.createElement('tr'); //创建行 
                    var sumCell_1 = document.createElement('td');
                    var sumCell_2 = document.createElement('td');
                    var sumCell_3 = document.createElement('td');
                    sumCell_1.innerHTML = name[m]; //个人姓名
                    sumCell_2.innerHTML = planDay[m]; //个人计划日
                    sumCell_3.innerHTML = totalDay[m++]; //个人含税日
                    row.appendChild(sumCell_1)
                    row.appendChild(sumCell_2)
                    row.appendChild(sumCell_3);
                    tbody.appendChild(row);
                }
            }
        }; break;

        case 4 : {
            for(; i < peopleMsg[4]; i++) {
                planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                jobTotalDay[14] += returnValue(isEmpty(allMsg[s_index].totalDay));
                name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                countNumPerJob += returnValue(totalDay[i]);
            }
            totalMoney.push(countNumPerJob*returnValue(peopleMoney[13]));   //小计
            k++;
            countMoney += totalMoney[0];    //合计
            /* 设置总的内容 */
            sumCell_1.innerHTML = '系统测试'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[4]);
            sumCell_2.innerHTML = peoplePlanDay[4]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[4]);
            sumCell_3.innerHTML = peopleTotalDay[4]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[4]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">测试工程师</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[14]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[14]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[14]);
            sumCell_6.innerHTML = peopleNum[14];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[14]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[14]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[4]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            for(let m = 1; m < peopleMsg[4]; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
        }; break;
        case 5 : {
            for(; i < peopleMsg[5]; i++) {
                planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                jobTotalDay[15] += returnValue(isEmpty(allMsg[s_index].totalDay));
                name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                countNumPerJob += returnValue(totalDay[i]);
            }
            totalMoney.push(countNumPerJob*returnValue(peopleMoney[14]));   //小计
            k++;
            countMoney += totalMoney[0];    //合计
            /* 设置总的内容 */
            sumCell_1.innerHTML = '业务支撑'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[5]);
            sumCell_2.innerHTML = peoplePlanDay[5]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[5]);
            sumCell_3.innerHTML = peopleTotalDay[5]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[5]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">业务经理</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[15]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[15]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[15]);
            sumCell_6.innerHTML = peopleNum[15];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[15]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[15]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[5]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            for(let m = 1; m < peopleMsg[5]; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
        }; break;
        case 6 : {
            for(; i < peopleMsg[6]; i++) {
                planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                jobTotalDay[16] += returnValue(isEmpty(allMsg[s_index].totalDay));
                name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                countNumPerJob += returnValue(totalDay[i]);
            }
            totalMoney.push(countNumPerJob*returnValue(peopleMoney[15]));   //小计
            k++;
            countMoney += totalMoney[0];    //合计
            /* 设置总的内容 */
            sumCell_1.innerHTML = '系统实施'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[6]);
            sumCell_2.innerHTML = peoplePlanDay[6]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[6]);
            sumCell_3.innerHTML = peopleTotalDay[6]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[6]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">实施工程师</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[16]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[16]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[16]);
            sumCell_6.innerHTML = peopleNum[16];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[16]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[16]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[6]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            for(let m = 1; m < peopleMsg[6]; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
        }; break;
        case 7 : {
            for(; i < peopleMsg[7]; i++) {
                planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                jobTotalDay[17] += returnValue(isEmpty(allMsg[s_index].totalDay));
                name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                countNumPerJob += returnValue(totalDay[i]);
            }
            totalMoney.push(countNumPerJob*returnValue(peopleMoney[16]));   //小计
            k++;
            countMoney += totalMoney[0];    //合计
            /* 设置总的内容 */
            sumCell_1.innerHTML = '项目管理'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[7]);
            sumCell_2.innerHTML = peoplePlanDay[7]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[7]);
            sumCell_3.innerHTML = peopleTotalDay[7]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[7]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">项目总监</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[17]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[16]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[17]);
            sumCell_6.innerHTML = peopleNum[17];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[17]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[17]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[7]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            for(let m = 1; m < peopleMsg[7]; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
        }; break;
        case 8 : {
            for(; i < peopleMsg[8]; i++) {
                planDay.push(isEmpty(allMsg[s_index].planDay)); //记录每个人的人日
                totalDay.push(isEmpty(allMsg[s_index].totalDay)); //记录每个人的税日
                jobTotalDay[18] += returnValue(isEmpty(allMsg[s_index].totalDay));
                name.push(isEmpty(allMsg[s_index++].name));//记录每个人的姓名
                countNumPerJob += returnValue(totalDay[i]);
            }
            totalMoney.push(countNumPerJob*returnValue(peopleMoney[17]));   //小计
            k++;
            countMoney += totalMoney[0];    //合计
            /* 设置总的内容 */
            sumCell_1.innerHTML = '技术管理'; //工作内容
            sumCell_1.style.cssText="font-size: 16px"
            sumCell_1.setAttribute('rowspan', peopleMsg[8]);
            sumCell_2.innerHTML = peoplePlanDay[8]; //计划日
            sumCell_2.setAttribute('rowspan', peopleMsg[8]);
            sumCell_3.innerHTML = peopleTotalDay[8]; //含税日
            sumCell_3.setAttribute('rowspan', peopleMsg[8]);
            sumCell_4.innerHTML = '<button type="button" class="layui-btn layui-btn-lg btn-checked">技术总监</button>'; //岗位
            sumCell_4.setAttribute('rowspan', peopleNum[18]);
            sumCell_5.innerHTML = isEmpty(peopleMoney[18]);   //岗位单价
            sumCell_5.setAttribute('rowspan', peopleNum[18]);
            sumCell_6.innerHTML = peopleNum[18];   //岗位人数
            sumCell_6.setAttribute('rowspan', peopleNum[18]);
            sumCell_7.innerHTML = name[0];   //第一个人名
            sumCell_8.innerHTML = planDay[0];   //第一个人日
            sumCell_9.innerHTML = totalDay[0];   //第一个税日
            sumCell_10.innerHTML = returnBlank(totalMoney[0]); //小计
            sumCell_10.setAttribute('rowspan', peopleNum[18]);
            sumCell_11.innerHTML = returnBlank(countMoney);   //合计
            sumCell_11.setAttribute('rowspan', peopleMsg[8]);
            rowSum.appendChild(sumCell_1);
            rowSum.appendChild(sumCell_2)
            rowSum.appendChild(sumCell_3)
            rowSum.appendChild(sumCell_4)
            rowSum.appendChild(sumCell_5)
            rowSum.appendChild(sumCell_6)
            rowSum.appendChild(sumCell_7)
            rowSum.appendChild(sumCell_8)
            rowSum.appendChild(sumCell_9)
            rowSum.appendChild(sumCell_10)
            rowSum.appendChild(sumCell_11);
            tbody.appendChild(rowSum);
            for(let m = 1; m < peopleMsg[8]; m++) {  //第二个人开始
                var row = document.createElement('tr'); //创建行 
                var sumCell_1 = document.createElement('td');
                var sumCell_2 = document.createElement('td');
                var sumCell_3 = document.createElement('td');
                sumCell_1.innerHTML = name[m]; //个人姓名
                sumCell_2.innerHTML = planDay[m]; //个人计划日
                sumCell_3.innerHTML = totalDay[m]; //个人含税日
                row.appendChild(sumCell_1)
                row.appendChild(sumCell_2)
                row.appendChild(sumCell_3);
                tbody.appendChild(row);
            }
        }; break;
    }
}
var systemIndexNum = -1;
function getDataRow2(typeId, jobArr, fun){
    systemIndexNum++;
    var flag = getFlagNum(jobArr, fun);// 1(平台) 2 3 41 42 43 44 45
    switch(flag){
        case 0 : {
            if(typeId == 41 || typeId == 42 || typeId == 43 || typeId == 44 || typeId == 45) {
                var t = document.getElementById('sys'+typeId);
                t.style.display="none";
            } else {
                setNullFun(typeId);
            }
        }; break;
        case 1 : {
            setJobArr(typeId, jobArr);
            setNullFun(typeId);
        }; break;
        case 2 : {
            setFun(typeId, fun)
        }; break;
        case 3 : {
            setJobArr(typeId, jobArr);
            setFun(typeId, fun);
        }; break;
    }
}

function getFlagNum(job, fun){
    var num = fun.funNum;
    var flag = (num == null || num == 0) ? 0 : 1;
    switch(job.length) {
        case 0: {
            switch(flag) {
                case 0: return 0;
                default: return 2;
            }; break;
        }; break;
        default: {
            switch(flag) {
                case 0: return 1;
                default: return 3;
            }; break;
        }; break;
    }
}

function setJobArr(index, jobArr){
    var money = 0;
    var day = 0;
    for(let i = 0, j = 1; i < 13; i++, j++) {
        if(jobArr[i] != null && jobArr[i].num != null) {
            $('#sys'+index+' #num_'+j).text(jobArr[i].num);
            $('#sys'+index+' #money_'+j).text(isEmpty(jobArr[i].money));
            $('#sys'+index+' #t_'+j).text(isEmpty(jobArr[i].planDay));
            $('#sys'+index+' #p_'+j).text(isEmpty(jobArr[i].totalDay));
            var total = returnValue(isEmpty(jobArr[i].totalDay) * returnValue(isEmpty(jobArr[i].money)));
            $('#sys'+index+' #total_'+j).text(returnBlank(total));
            money += total;
            day += isEmpty(jobArr[i].planDay);
        }
    }
    $('#sys'+index+' #total').text(returnBlank(money));
    systemTotalNum[systemIndexNum] = returnBlank(money) != "" ? money : null;
    $('#sys'+index+' #totalDay2').text(returnBlank(day));
}

function setFun(index, fun){
    if(fun.funNum != null && fun.funNum != 0) {
        var funNameArr = fun.funName.split('_');
        var funNum = fun.funNum;
        var funMsgArr = fun.funMsg.split('/');
        var nameT;
        switch(index){
            case 1 : nameT  = "基础平台"; break;
            case 2 : nameT  = "接口层"; break;
            case 3 : nameT  = "服务层"; break;
            case 41 : nameT = "应用层——小程序端"; break;
            case 42 : nameT = "应用层——H5端"; break;
            case 43 : nameT = "应用层——客户端(App)"; break;
            case 44 : nameT = "应用层——PC端"; break;
            case 45 : nameT = "应用层——公众号端"; break;
        }

        var t = document.getElementById('sys'+index);

        var row_1 = document.createElement('tr');
        var cell_1 = document.createElement('td');
        cell_1.innerHTML = projectName;
        cell_1.style.cssText="font-size: 16px"
        cell_1.setAttribute('rowspan', funNum);
        cell_1.setAttribute('colspan', 2);
        var cell_2 = document.createElement('td');
        cell_2.innerHTML = nameT;
        cell_2.style.cssText="font-size: 16px"
        cell_2.setAttribute('rowspan', funNum);
        var cell_3 = document.createElement('td');
        cell_3.innerHTML = funNameArr[0];
        var cell_4 = document.createElement('td');
        cell_4.innerHTML = funMsgArr[0];
        cell_4.setAttribute('colspan', 5);
        row_1.appendChild(cell_1)
        row_1.appendChild(cell_2)
        row_1.appendChild(cell_3)
        row_1.appendChild(cell_4);
        t.appendChild(row_1);

        for(let i = 1; i < funNum; i++) {
            var row = document.createElement('tr');
            var ocell_1 = document.createElement('td');
            ocell_1.innerHTML = funNameArr[i];
            var ocell_2 = document.createElement('td');
            ocell_2.innerHTML = funMsgArr[i];
            ocell_2.setAttribute('colspan', 5);
            row.appendChild(ocell_1)
            row.appendChild(ocell_2);
            t.appendChild(row);
        }
    }
}

function setNullFun(index){
    var t = document.getElementById('sys'+index);
    var row = document.createElement('tr');
    var cell = document.createElement('td');
    cell.style.cssText="font-size: 16px"
    cell.innerHTML = "无数据";
    cell.setAttribute('colspan', 10);
    row.appendChild(cell);
    t.appendChild(row);
}
